package com.wwf.myblog.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author lulei
 * @date 2020年12月10日 15:39:24
 */
@Configuration
@PropertySource("classpath:test.properties")
@EnableConfigurationProperties(MyTestProperties.class)
@ConfigurationProperties(prefix = "test")
public class MyTestProperties {
    private Integer id;
    private String username;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "MyTestProperties{" +
                "id=" + id +
                ", username='" + username + '\'' +
                '}';
    }
}
